from selenium import webdriver

class test():
    driver = webdriver.Edge()
    driver.get('')
    driver.save_screenshot()
    driver.switch_to.frame()
    driver.switch_to.default_content()
    a=driver.switch_to.alert
    a.accept()
    a.dismiss()
    driver.execute_script('window.scrollTO(0,document.body.scrollHeight)')
    driver.switch_to.window(driver.window_handles[-1])
